package com.service;

import com.DTO.EnrollDTO;
import com.DTO.LoginDTO;
import com.Exception.NormalException.FileExceptions.FileFormatException;
import com.Exception.NormalException.UserExceptions.*;
import com.entity.User;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author XTC
 * @since 2024-07-10
 */
public interface UserService extends IService<User> {
    User login(LoginDTO loginDTO) throws NoSuchUserException, PasswordErrorException;

    boolean enroll(EnrollDTO enrollDTO) throws PhoneAlreadyEnrollException;

    boolean update(User user);

    boolean updatePhone(Integer userId, String phone) throws PhoneAlreadyEnrollException, NullPhoneException;

    String uploadHead(Integer userId, MultipartFile head) throws FileFormatException, IOException;
}
